<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${ctx}/css/index_work.css">
    <script src="${ctx}/bootstrap/jquery-1.9.1.min.js"></script>
</head>
<body>
<a href="${ctx}/toadd.do">添加</a>
<form>
    <input type="hidden" name="pageNum">
    <input type="text" name="name">
    <input type="submit" value="查询">
</form>
<table>
<tr>
    <td>序号</td>
    <td>名称</td>
    <td>省市|</td>
    <td>市级|</td>
    <td>县级|</td>
    <td>地区</td>
    <td>景点详情</td>
    <td>操作</td>
</tr>
    <c:forEach items="${list}" var="var" varStatus="vs">
        <tr>
            <td>${vs.index+PageInfo.startRow}</td>
            <td>${var.name}</td>
            <td>${var.shengname}</td>
            <td>${var.shiname}</td>
            <td>${var.xianname}</td>
            <td>${var.address}</td>
            <td>
                <c:forEach items="${var.tscenicdetails}" var="vv">
                    ${vv.title}|${vv.id}
                </c:forEach>
            </td>
            <td>
                <a href="${ctx}/getTscenic.do?id=${var.id}">景点详情</a>
                <a href="${ctx}/toadd.do?id=${var.id}">修改</a>
            </td>
        </tr>
    </c:forEach>
</table>
<a href="##" onclick="fenye(1)">首页</a>
<a href="##" onclick="fenye(${PageInfo.prePage})">上一页</a>
<a href="##" onclick="fenye(${PageInfo.nextPage})">下一页</a>
<a href="##" onclick="fenye(${PageInfo.pages})">尾页</a>
<script>
    function fenye(pageNum) {
        $('[name="pageNum"]').val(pageNum);
        $("form").submit();
    }
</script>
</body>
</html>